<?php

	global $wpdb;
	
	$db_name = "nivo_slider"; 
	include (TEMPLATEPATH . '/framework/includes/get_'.$db_name.'_db.php');

	$slider_datas = $wpdb->get_results("SELECT * FROM $table_name ORDER BY orderby");

?>

<!-- begin banner -->
<div class="banner">

		<!-- begin banner model #1 -->
		<div class="banner_model_1">

			<?php if(!$slider_datas){ ?>
				<div class="slider_default picloader">
					<img src="<?php bloginfo('template_url'); ?>/images/default/slider.png" alt=""/>
				</div>
			<?php } else { ?>
			
			<div id="sliderNivo">
				<?php 	
					$s=0;
					foreach ($slider_datas as $data){	
				?>
				
				<?php 
				if($data->url){ echo "<a href=\"".$data->url."\" target=\"".$data->target."\">";	} else { echo "<div>"; } ?>
				
						<img src="<?php echo $data->src; ?>" width="<?php echo get_option('nivo_slider_width', '940'); ?>" height="<?php echo get_option('nivo_slider_height', '300'); ?>" alt="" />
				
						<span class="holder_desc">
							<?php if($data->title){ ?>
							<span class="ntitle"><?php echo $data->title; ?></span><br />
							<?php } ?>
							<?php if($data->description){ ?>
							<span class="ndescription" <?php if(!$data->title){ ?>style="margin-top:<?php echo get_option('nivo_slider_title_size', '24')+get_option('nivo_slider_description_size', '12'); ?>px;"<?php } ?>><?php echo $data->description; ?></span>
							<?php } ?>
						</span>
						
				<?php if($data->url){ echo "</a>";	} else { echo "</div>"; } ?>
				
				<?php } ?>
			
			</div>
			<div class="hide_desc"></div>
			<?php } ?>
			
		</div>
		<!-- end banner model #1 -->
		
</div>
<!-- end banner -->